ConfigText = ConfigText or Class("ConfigText", EventDispatcher)

---@diagnostic disable-next-line: duplicate-set-field
function ConfigText:ctor(args)
    EventDispatcher.ctor(self)
    self.id = args.id
    self.name = args.name
    self.desc = args.desc
    self.texts = args.texts or {}
end

function ConfigText:changeName(name)
    self.name = name
    self:emit(ConfigEvent.ChangeTextName, self.id)
end

function ConfigText:getText(languageId)
    return self.texts[languageId] or "-"
end

function ConfigText:getTexts()
    return self.texts
end